package mxmf.data;

import java.util.Collections;
import java.util.List;
import java.util.Map;

public class DataInfo {

    private Map<String, List<Permission>> permissions;

    public List<Permission> getCpList() {
        if (permissions == null) {
            return Collections.emptyList();
        }
        return permissions.getOrDefault(Permission.CODE_CP, Collections.emptyList());
    }

    public List<Permission> getOpList() {
        if (permissions == null) {
            return Collections.emptyList();
        }
        return permissions.getOrDefault(Permission.CODE_OP, Collections.emptyList());
    }

    public List<Permission> getTypeCodeList() {
        if (permissions == null) {
            return Collections.emptyList();
        }
        return permissions.getOrDefault(Permission.CODE_TYPE_CODE, Collections.emptyList());
    }
    
    public List<Permission> getDisableList() {
        if (permissions == null) {
            return Collections.emptyList();
        }
        return permissions.getOrDefault(Permission.CODE_DISABLED_PARTNER, Collections.emptyList());
    }

    public void setPermissions(Map<String, List<Permission>> permissions) {
        this.permissions = permissions;
    }

}
